﻿namespace UnityEditor
{
    using System;
    using System.Runtime.CompilerServices;
    using System.Runtime.InteropServices;
    using UnityEngine;

    public sealed class AnimationUtility
    {
        [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
        public static extern string CalculateTransformPath(Transform targetTransform, Transform root);
        [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
        internal static extern void ClearEditorCurve(AnimationClip clip, string relativePath, int classID, int scriptInstanceID, string propertyName);
        [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
        public static extern void ConstrainToPolynomialCurve(AnimationCurve curve);
        [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
        internal static extern bool CurveSupportsProcedural(AnimationCurve curve);
        public static AnimationClipCurveData[] GetAllCurves(AnimationClip clip)
        {
            bool includeCurveData = true;
            return GetAllCurves(clip, includeCurveData);
        }

        [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
        public static extern AnimationClipCurveData[] GetAllCurves(AnimationClip clip, bool includeCurveData);
        [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
        public static extern UnityEngine.Object[] GetAnimatableObjects(GameObject go);
        [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
        public static extern AnimationClipCurveData[] GetAnimatableProperties(GameObject go);
        [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
        public static extern AnimationClipCurveData[] GetAnimatablePropertiesForObject(UnityEngine.Object animatedObject, GameObject gameObject);
        [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
        public static extern AnimationClip[] GetAnimationClips(Animation component);
        [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
        public static extern AnimationEvent[] GetAnimationEvents(AnimationClip clip);
        [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
        internal static extern ModelImporterAnimationType GetAnimationType(AnimationClip clip);
        [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
        public static extern AnimationCurve GetEditorCurve(AnimationClip clip, string relativePath, System.Type type, string propertyName);
        [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
        public static extern bool GetFloatValue(GameObject root, string relativePath, System.Type type, string propertyName, out float data);
        [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
        public static extern bool InAnimationMode();
        [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
        public static extern bool IsValidPolynomialCurve(AnimationCurve curve);
        [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
        public static extern void SetAnimationClips(Animation component, AnimationClip[] clips);
        [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
        public static extern void SetAnimationEvents(AnimationClip clip, AnimationEvent[] events);
        [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
        public static extern void SetEditorCurve(AnimationClip clip, string relativePath, System.Type type, string propertyName, AnimationCurve curve);
        [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
        public static extern void StartAnimationMode(UnityEngine.Object[] objects);
        [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
        public static extern void StopAnimationMode();
    }
}

